﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;


namespace Camera
{
    public partial class setting : Form
    {
        public static Boolean defaul = false;
        public setting()
        {
            InitializeComponent(); 
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Filter.BitmapFilter.Invert(Main.image);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Filter.BitmapFilter.GrayScale(Main.image); 
        }

        private void setting_Load(object sender, EventArgs e)
        {
            
        }

        private void button3_Click(object sender, EventArgs e)
        {
            
             defaul = true;
        }

        private void BrightnessBt_Click(object sender, EventArgs e)
        {
            if (BrightnessText.Text != "")
            {
                int value = Convert.ToInt32(BrightnessText.Text);
                Filter.BitmapFilter.Brightness(Main.image, value);
            }
        }

        private void ContrastBt_Click(object sender, EventArgs e)
        {
            if (ContrastText.Text != "")
            {
                int value = Convert.ToInt32(ContrastText.Text);
                Filter.BitmapFilter.Contrast(Main.image, (sbyte)value);
            }
        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            double red = Convert.ToDouble(redBt.Text);
            double green = Convert.ToDouble(greenBt.Text);
            double blue = Convert.ToDouble(blueBt.Text);
            Filter.BitmapFilter.Gamma(Main.image, red, green, blue);
            
        }

        private void button2_Click_1(object sender, EventArgs e)
        {
            int red = Convert.ToInt32(redBtC.Text);
            int green = Convert.ToInt32(greenBtC.Text);
            int blue = Convert.ToInt32(blueBtC.Text);
            Filter.BitmapFilter.Color(Main.image, red, green, blue);
        }

        private void SmoothBt_Click(object sender, EventArgs e)
        {
            Filter.BitmapFilter.Smooth(Main.image, 8);//8
        }

        private void GaussianBlurBt_Click(object sender, EventArgs e)
        {
            Filter.BitmapFilter.GaussianBlur(Main.image, 4);
        }

        private void MeanRemovalBt_Click(object sender, EventArgs e)
        {
            Filter.BitmapFilter.MeanRemoval(Main.image,11);//11
        }

        private void SharpenBt_Click(object sender, EventArgs e)
        {
            Filter.BitmapFilter.Sharpen(Main.image, 11);
        }

        private void EmbossLaplacianBt_Click(object sender, EventArgs e)
        {
            Filter.BitmapFilter.EmbossLaplacian(Main.image);
        }

        private void EdgeDetectQuickBt_Click(object sender, EventArgs e)
        {
            Filter.BitmapFilter.EdgeDetectQuick(Main.image);
        }

        private void InvertBt_Click(object sender, EventArgs e)
        {
            Filter.BitmapFilter.Invert(Main.image);
        }
    }
}
